import http from 'k6/http';

var host = 'http://demoUrl';

var filePath = 'D:\file.json';
var fileJson = JSON.parse(open(filePath));


export default function(){

	var url = host+'/varCenter/Config/get-config-item-list-query';
	
	var params = {header:{
		'Authorization': 'Bearer 1887C52F77CA36927DB0397E91A371DCDACAF2D11338F101DC94D536B8BF82F3',
		'Content-Type': 'application/json',
	}};
	let res = http.get(url, params);
	var resBody = res.body;//获取响应体数据
	var jsonObject = JSON.parse(resBody);//解析JSON字符串，构造由字符串描述的JavaScript对象
	var id = JSON.stringify(jsonObject.data.id);//获取id值的对象,并将对象转换为 JSON 字符串
	console.log(id);//打印id值内容
}